<%@ page language="java" contentType="application/vnd.ms-excel; name='member'; charset=UTF-8" pageEncoding="UTF-8"  import="java.util.*,common.*,java.sql.*,db.*"%>
<%
response.setHeader("Content-Disposition", "inline; filename=ent.xls"); // 파일 이름 지정
response.setHeader("Content-Description", "JSP Generated Data");
%>    
<%
request.setCharacterEncoding("utf-8");

String ent_id 		= "";
String ent_nm		= "";
String ent_alias		= "";
String login_id_map 		= "";
String login_name 	= "";
String addr	= "";
String start_dt 	= "";
String close_dt	= "";
String use_yn	= "";

String service_gubun	= "";
String ref_url	= "";
String ref_chk_yn	= "";
String test_cost	= "";
String test_cost_discount	= "";

String reg_dt	= "";
String r_num="";
        
String user_id = CommonUtil.nvl(request.getParameter("user_id"));

String s_service_gubun = CommonUtil.nvl(request.getParameter("s_service_gubun"),"");
String search_combo = CommonUtil.nvl(request.getParameter("search_combo"));
String keyword = CommonUtil.nvl(request.getParameter("keyword"));
String line_number = CommonUtil.nvl(request.getParameter("line_number"),"10");
String total_count = CommonUtil.nvl(request.getParameter("total_count"),"0");
String curr_page = CommonUtil.nvl(request.getParameter("curr_page"),"1");

        String[] param = new String[7];
		param[0] = user_id;	
		param[1] = search_combo;	
		param[2] = keyword;	
		param[3] = total_count;	
		param[4] = total_count;	
		param[5] = "1";	
		param[6] = s_service_gubun;	
		
		Connection con=null;
		ArrayList list =null;
		HashMap listMap = new HashMap();	
		
		try {	
			con = (new CommonConnect()).getConnection_ds1();			
			
			String queryStr = "call sp_sp0901_list(?,?,?,?,?,?,?)";	
			list = DAO.select(con,queryStr,param);	
			
			
		} catch (Exception e) {
			e.printStackTrace();
		}finally {
			  try{
				  if (con!=null) con.close();
			  }catch(Exception ee){}
		}
		
		
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Excel Download</title>
</head>
<body>
<form name="excel_frm">
<b></b>
</BR>
</BR>
<table width="760" border="1" cellpadding="2" cellspacing="0" bordercolor="C0C0C0" bordercolordark="#FFFFFF" frame=below >
	<tr height="23">
		<td width="50" bgcolor="#D3EBD7" align="center"> 번호 </td>
		<td width="160" bgcolor="#D3EBD7" align="center"> 기업명 </td>
		<td width="160" bgcolor="#D3EBD7" align="center"> 기업 alias </td>
		<td width="160" bgcolor="#D3EBD7" align="center"> 주소 </td>
		<td width="160" bgcolor="#D3EBD7" align="center"> 시작일 </td>
	    <td width="160" bgcolor="#D3EBD7" align="center"> 종료일 </td>
	    <td width="160" bgcolor="#D3EBD7" align="center"> 사용구분 </td>
		<td width="160" bgcolor="#D3EBD7" align="center"> 서비스유무 </td>
		<td width="160" bgcolor="#D3EBD7" align="center"> 레퍼런스URL </td>
		<td width="160" bgcolor="#D3EBD7" align="center"> 레퍼런스사용유무 </td>
		<td width="160" bgcolor="#D3EBD7" align="center"> 테스트비용 </td>
		<td width="160" bgcolor="#D3EBD7" align="center"> 할인가 </td>
		<td width="400" bgcolor="#D3EBD7" align="center"> 등록일 </td>
	</tr>
	<% for (int i=0; i< list.size(); i++) {
		  listMap=(HashMap)list.get(i);
		        
		  r_num = CommonUtil.nvl((String)listMap.get("r_num"));
		  ent_id = CommonUtil.nvl((String)listMap.get("ent_id"));
		  ent_nm = CommonUtil.nvl((String)listMap.get("ent_nm"));
		  ent_alias = CommonUtil.nvl((String)listMap.get("ent_alias"));
	      
			      
		  addr = CommonUtil.nvl((String)listMap.get("addr"));
		  
		  start_dt = CommonUtil.nvl((String)listMap.get("start_dt"));
		  close_dt = CommonUtil.nvl((String)listMap.get("close_dt"));
		  
		  use_yn = CommonUtil.nvl((String)listMap.get("use_yn"));
		  service_gubun = CommonUtil.nvl((String)listMap.get("service_gubun"));
		  
		  ref_url = CommonUtil.nvl((String)listMap.get("ref_url"));
		  ref_chk_yn = CommonUtil.nvl((String)listMap.get("ref_chk_yn"));
		  test_cost = CommonUtil.nvl((String)listMap.get("test_cost"));
		  test_cost_discount = CommonUtil.nvl((String)listMap.get("test_cost_discount"));
		  
	      reg_dt = CommonUtil.nvl((String)listMap.get("reg_dt"));
	%>
	<tr height="23">
		<td align="center"> <%= r_num %> </td>
	    <td align="center"> <%= ent_nm %> </td>
	    <td align="center"> <%= ent_alias%> </td>
	    <td align="center"> <%= addr %> </td>
	    
	    <td align="center"> <%= start_dt %> </td>
	    
	    <td align="center"> <%= close_dt %> </td>
	    <td align="center"> <%= use_yn %> </td>
	    <td align="center"> <%= service_gubun %> </td>
	    
	    <td align="center"> <%= ref_url %> </td>
	    <td align="center"> <%= ref_chk_yn %> </td>
	    <td align="center"> <%= test_cost %> </td>
	    <td align="center"> <%= test_cost_discount %> </td>
	    
		<td align="center"> <%= reg_dt %> </td>
		
	</tr>
	<% }%>
</table>
</form>
</body>
</html>
